<%-- 
    Document   : optionfood
    Created on : Nov 21, 2011, 9:13:24 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.ThamSoHT,Models.ThamSoHT_Model, Models.NhomMA_Model, Models.MonAn_Model, Models.TuyChon_Model"%>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'chkoptionmsg', 'abbreviation', 'addmore', 'checkoptionmsg', 'description', 'foodgroups', 'foodname', 'optionfood', 'notice', 'optionname', 'rightmsg' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String abbreviation = mdsts[0].getTenTS();
            String addmore = mdsts[1].getTenTS();
            String chkoptionmsg = mdsts[2].getTenTS();
            String checkoptionmsg = mdsts[3].getTenTS();
            String description = mdsts[4].getTenTS();
            String foodgroups = mdsts[5].getTenTS();
            String foodname = mdsts[6].getTenTS();            
            String notice = mdsts[7].getTenTS();
            String optionfood = mdsts[8].getTenTS();
            String optionname = mdsts[9].getTenTS();
            String rightmsg = mdsts[10].getTenTS();

            String msgright = notice + "/" + rightmsg;
            String msgcheckoption = notice + "/" + checkoptionmsg;
            String msgchkoption = notice + "/" + chkoptionmsg;

            Vector vMA = (Vector) request.getAttribute("MA");
            Vector vTCMA = (Vector) request.getAttribute("TCMA");
            String mama = (String) request.getAttribute("mama");

%>
<div >
    <div class="title">
        <%=optionfood%>        
    </div>
    <div class="content">
        <form name="addFood" action="">
            <%
                for(int i=0; i<vMA.size(); i++){
                    Beans.MonAn ma = (Beans.MonAn) vMA.elementAt(i);%>
                <div style=" float: left; width: 38%; margin-left: 20px; margin-top: 20px; margin-bottom: 20px;">
                <div style="width: 110px; float: left; margin-left: 5px; "><label><%=foodgroups %></label></div>
                <select name="nhommonan" style=" width: 200px; margin-bottom: 20px;">
                    <option value="<%=ma.getMaNMA() %>"><%=NhomMA_Model.LayTenNhomMA(ma.getMaNMA(), langid) %></option>>
                </select><br />
                <div style="width: 110px; float: left; margin-left: 5px; "><label><%=foodname %></label></div>
                <input type="text" value="<%=ma.getTenMA() %>" disabled style=" width: 200px; margin-bottom: 20px;" class="text" name="tenmonan"/><br />
                <div style="width: 110px; float: left; margin-left: 5px; "><label><%=abbreviation %></label></div>
                <input type="text" value="<%=ma.getTenMAVT() %>" disabled style=" width: 200px; margin-bottom: 20px;" class="text" name="tenviettat"/><br />
                <div style="width: 110px; float: left; margin-left: 5px; "><label><%=description %></label></div>
                <textarea class="textarea" disabled style=" margin-bottom: 15px; height: 60px; width: 200px;"  name="mota"><%=ma.getMoTa() %></textarea><br />
                </div>
                <div style="float: left; margin-top: 20px; margin-bottom: 30px;">
                    <img style=" width: 200px; height: 190px;" alt="" src="../images/foodimages/<%=MonAn_Model.LayTenHinhAnh(ma.getMaMA())%>">
                </div>
            <%  }
            %>
            <div>
            <table style=" width: 36%; margin-top: 15px; padding-left: 40px;" >
                <thead>
                    <tr>                        
                        <th style="width: 50%; border: none; background: none; padding-bottom: 15px;"><%=optionname %>
                            <a href="#" style=" margin-left: 15px;" id="<%=msgcheckoption%>" lang="<%=msgchkoption %>" name="<%=mama %>" onclick="Addmoreoption(this.id, this.name, this.lang)"><%=addmore%></a>
                        </th>
                    </tr>
                </thead>
                <tbody id="tuychonma">
                    <%
                        for(int i=0; i<vTCMA.size(); i++){
                            Beans.TuyChonMA tcma = (Beans.TuyChonMA) vTCMA.elementAt(i);%>
                            <tr>
                                <td style="border: none; background: none;">
                                    <div style=" float: left; width: 120px;">
                                        <%=TuyChon_Model.LayTenTC(tcma.getMaTC(), langid)  %>
                                    </div>
                                    <a href="#" id="<%=tcma.getMaMA() %>" lang="<%=tcma.getMaTC() %>" name="<%=msgright%>" onclick="DeleteOptionFood(this.name, this.id, this.lang)"><img style=" height: 15px; width: 15px; margin-top: 2px;" alt="" src="../images/del.png"></a>
                                </td>
                            </tr>
                    <%  }
                    %>
                </tbody>
            </table>
            </div>
        </form>
    </div>
</div>